package cn.globalph.housekeeper.ui.profile

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.navigation.fragment.findNavController
import cn.globalph.housekeeper.R
import cn.globalph.housekeeper.data.TokenStorage
import cn.globalph.housekeeper.ui.BaseFragment
import cn.globalph.housekeeper.ui.login.LoginActivity

class ProfileTempFragment :BaseFragment(){

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val fragView = inflater.inflate(R.layout.fragment_profile_temp,container,false)
        fragView.findViewById<ImageView>(R.id.bar_back).setOnClickListener {
            findNavController().popBackStack()
        }
        fragView.findViewById<TextView>(R.id.bar_title).text = "个人中心"

        fragView.findViewById<Button>(R.id.exit_login).setOnClickListener{
            TokenStorage.exitLogin(context!!)
            startActivity(Intent(context,LoginActivity::class.java))
            activity?.finish()
        }
        return fragView
    }
}